Skip to content

Merge latest from upstream - #3

Merged
danblaker merged 15 commits into
openupresources:masterfrom
ruby-docx:master
Apr 2, 2026
Merged

Merge latest from upstream#3
danblaker merged 15 commits into
openupresources:masterfrom
ruby-docx:master

Conversation

@danblaker

Copy link
Copy Markdown

No description provided.

satoryu and others added 15 commits April 20, 2025 15:07
Accepts files whose extension is not .docx or which does not have extension
…ih access to MatchData with regex capture groups etc

I needed to do a `substitute` where the match arg was a regex, and if it were gsub I'd be using a block to have access to capture groups in $1 $2 $3 etc. Because of the weird way variables $1 $2 $3 are handled in ruby and block scope, I couldn't provide a delegated block to give exactly the same API as ordinary gsub. My original idea was to do that, added on to existing #substitute.

But instead, had to provide a new/alternate #substitute_with_block method, with a block that actually gets a MatchData object as arg, and can access whatever it needs from there, including capture groups and match string.
Allow rubyzip 3.x as well as 2.x in gemspec
Add substitute_with_block method to TextRun, that can take a block wtih access to MatchData with regex capture groups etc
@danblaker
danblaker requested a review from pvande March 22, 2026 04:34

@pvande pvande left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine? I'm not sure what the differences in our fork are, or how they interact with these changes, so I'm trusting that we're supporting them with appropriate testing.

@danblaker
danblaker merged commit 5f24e52 into openupresources:master Apr 2, 2026
0 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants